﻿#ifndef STOCK_H
#define STOCK_H

#include <QDialog>
#include "env.h"
#include "optioneditor.h"

namespace Ui {
class Stock;
}

class Stock : public QDialog
{
    Q_OBJECT

public:
    explicit Stock(QWidget *parent = 0);
    ~Stock();

    bool init();
    bool saveRecord();
    void updateView();
    void sendMsg(const QString &title,const QString &content);

private slots:
    void on_btn_send_clicked();
    void on_btn_submit_clicked();
    void on_btn_save_clicked();
    void reload(const OptionType &type);

    void on_provider_currentTextChanged(const QString &text);

private:
    Ui::Stock *ui;
    OptionHandler option;

    QString name,remark;
    QString notice;
    QString provider;
    QString number;

    QSqlTableModel *model;
    QUdpSocket *sender;
};

#endif // STOCK_H
